package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.MedicineStandardMapper;
import com.ruoyi.system.domain.MedicineStandard;
import com.ruoyi.system.service.IMedicineStandardService;

/**
 * 中药材标准库库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-01-23
 */
@Service
public class MedicineStandardServiceImpl implements IMedicineStandardService 
{
    @Autowired
    private MedicineStandardMapper medicineStandardMapper;

    /**
     * 查询中药材标准库库
     * 
     * @param id 中药材标准库库主键
     * @return 中药材标准库库
     */
    @Override
    public MedicineStandard selectMedicineStandardById(Long id)
    {
        return medicineStandardMapper.selectMedicineStandardById(id);
    }

    /**
     * 查询中药材标准库库列表
     * 
     * @param medicineStandard 中药材标准库库
     * @return 中药材标准库库
     */
    @Override
    public List<MedicineStandard> selectMedicineStandardList(MedicineStandard medicineStandard)
    {
        return medicineStandardMapper.selectMedicineStandardList(medicineStandard);
    }

    /**
     * 新增中药材标准库库
     * 
     * @param medicineStandard 中药材标准库库
     * @return 结果
     */
    @Override
    public int insertMedicineStandard(MedicineStandard medicineStandard)
    {
        medicineStandard.setCreateTime(DateUtils.getNowDate());
        return medicineStandardMapper.insertMedicineStandard(medicineStandard);
    }

    /**
     * 修改中药材标准库库
     * 
     * @param medicineStandard 中药材标准库库
     * @return 结果
     */
    @Override
    public int updateMedicineStandard(MedicineStandard medicineStandard)
    {
        medicineStandard.setUpdateTime(DateUtils.getNowDate());
        return medicineStandardMapper.updateMedicineStandard(medicineStandard);
    }

    /**
     * 批量删除中药材标准库库
     * 
     * @param ids 需要删除的中药材标准库库主键
     * @return 结果
     */
    @Override
    public int deleteMedicineStandardByIds(Long[] ids)
    {
        return medicineStandardMapper.deleteMedicineStandardByIds(ids);
    }

    /**
     * 删除中药材标准库库信息
     * 
     * @param id 中药材标准库库主键
     * @return 结果
     */
    @Override
    public int deleteMedicineStandardById(Long id)
    {
        return medicineStandardMapper.deleteMedicineStandardById(id);
    }
}
